import service from '@/utils/request'
// @Tags Model
// @Summary 创建model表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Model true "创建model表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /model/createModel [post]
export const createModel = (data) => {
  return service({
    url: '/model/createModel',
    method: 'post',
    data
  })
}

// @Tags Model
// @Summary 删除model表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Model true "删除model表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /model/deleteModel [delete]
export const deleteModel = (params) => {
  return service({
    url: '/model/deleteModel',
    method: 'delete',
    params
  })
}

// @Tags Model
// @Summary 批量删除model表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除model表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /model/deleteModel [delete]
export const deleteModelByIds = (params) => {
  return service({
    url: '/model/deleteModelByIds',
    method: 'delete',
    params
  })
}

// @Tags Model
// @Summary 更新model表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Model true "更新model表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /model/updateModel [put]
export const updateModel = (data) => {
  return service({
    url: '/model/updateModel',
    method: 'put',
    data
  })
}

// @Tags Model
// @Summary 用id查询model表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query model.Model true "用id查询model表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /model/findModel [get]
export const findModel = (params) => {
  return service({
    url: '/model/findModel',
    method: 'get',
    params
  })
}

// @Tags Model
// @Summary 分页获取model表列表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取model表列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /model/getModelList [get]
export const getModelList = (params) => {
  return service({
    url: '/model/getModelList',
    method: 'get',
    params
  })
}

// @Tags Model
// @Summary 不需要鉴权的model表接口
// @Accept application/json
// @Produce application/json
// @Param data query deviceReq.ModelSearch true "分页获取model表列表"
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
// @Router /model/getModelPublic [get]
export const getModelPublic = () => {
  return service({
    url: '/model/getModelPublic',
    method: 'get',
  })
}
